package com.gxuwz.prrs.utils;

import android.app.Notification;
import android.app.NotificationChannel;
import android.app.NotificationManager;
import android.content.Context;

import static android.content.Context.NOTIFICATION_SERVICE;

public class NotificationHelper {

	public static void sendNotification(Context context, String title, String message, String channelId, String channelName,
										int notifyId, int importance, int smallIcon) {
		NotificationManager notificationManager = (NotificationManager) context.getSystemService(NOTIFICATION_SERVICE);
		NotificationChannel channel = new NotificationChannel(channelId, channelName, importance);
		notificationManager.createNotificationChannel(channel);
		Notification notification = new Notification.Builder(context, channelId)
				.setContentTitle(title)
				.setContentText(message)
                .setWhen(System.currentTimeMillis())
				.setSmallIcon(smallIcon)
				.build();
		notificationManager.notify(notifyId, notification);
	}
}
